<%@page contentType="text/html;charset=utf-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>学生成绩管理系统 - 添加学生信息</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.bootcdn.net/ajax/libs/bootstrap-datepicker/1.9.0/css/bootstrap-datepicker.css"
          rel="stylesheet">
    <script src="js/jquery-2.1.0.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/bootstrap-datepicker/1.9.0/js/bootstrap-datepicker.js"></script>
</head>
<body>
<div class="container">
    <center><h3>添加学生信息</h3></center>
    <form action="" method="post">
        <div class="form-group">
            <label for="name">姓名：</label>
            <input type="text" class="form-control" id="name" name="name" placeholder="请输入姓名">
        </div>

        <div class="form-group">
            <label>性别：</label>
            <input type="radio" name="sex" value="1"/>男
            <input type="radio" name="sex" value="2"/>女
        </div>

        <div class="form-group">
            <label>出生日期：</label>
            <!--指定 date标记-->
            <div class='input-group date' id='birthday'>
                <input type='text' class="form-control" name="birthday" readonly/>
                <span class="input-group-addon">
                    <span class="glyphicon glyphicon-calendar"></span>
                </span>

            </div>
        </div>
        <div class="form-group">
            <label for="address">地址：</label>
            <input type="text" class="form-control" id="address" name="address" placeholder="请输入地址">
        </div>

        <div class="form-group">
            <label for="phone">电话：</label>
            <input type="text" class="form-control" id="phone" name="phone" placeholder="请输入电话">
        </div>

        <div class="form-group">
            <label for="idcard">身份证号：</label>
            <input type="text" class="form-control" id="idcard" name="idcard" placeholder="请输入身份证号">
        </div>
        <div class="form-group">
            <label for="major">专业：</label>
            <select class="form-control" id="major" name="departmentID">
                <option value=""></option>
                <c:forEach items="${majors}" var="item" varStatus="status">
                    <option value="${item.id}">${item.name}</option>
                </c:forEach>
            </select>
        </div>


        <div class="form-group" style="text-align: center">
            <input class="btn btn-primary" type="submit" value="添加"/>
            <a class="btn btn-default" href="javascript:window.history.back();">返回</a>
        </div>
    </form>
</div>
<script>
    $(function () {
        $('#birthday').datepicker({
            language: 'zh-CN',
            todayBtn: "linked",
            keyboardNavigation: false,
            forceParse: false,
            calendarWeeks: true,
            format: "yyyy-mm-dd",
            autoclose: true
        });
    });
</script>
</body>
</html>